# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Label do
  @moduledoc """
  A label defines a taxonomy that can be applied to Drive items in order to organize and search across items. Labels can be simple strings, or can contain fields that describe additional metadata that can be further used to organize and search Drive items.

  ## Attributes

  *   `appliedCapabilities` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedCapabilities.t`, *default:* `nil`) - Output only. The capabilities related to this label on applied metadata.
  *   `appliedLabelPolicy` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy.t`, *default:* `nil`) - Output only. Behavior of this label when it's applied to Drive items.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this label was created.
  *   `creator` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t`, *default:* `nil`) - Output only. The user who created this label.
  *   `customer` (*type:* `String.t`, *default:* `nil`) - Output only. The customer this label belongs to. For example: "customers/123abc789."
  *   `disableTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this label was disabled. This value has no meaning when the label is not disabled.
  *   `disabler` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t`, *default:* `nil`) - Output only. The user who disabled this label. This value has no meaning when the label is not disabled.
  *   `displayHints` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelDisplayHints.t`, *default:* `nil`) - Output only. UI display hints for rendering the label.
  *   `fields` (*type:* `list(GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Field.t)`, *default:* `nil`) - List of fields in descending priority order.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. Globally unique identifier of this label. ID makes up part of the label `name`, but unlike `name`, ID is consistent between revisions. Matches the regex: `([a-zA-Z0-9])+`
  *   `labelType` (*type:* `String.t`, *default:* `nil`) - Required. The type of label.
  *   `learnMoreUri` (*type:* `String.t`, *default:* `nil`) - Custom URL to present to users to allow them to learn more about this label and how it should be used.
  *   `lifecycle` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Lifecycle.t`, *default:* `nil`) - Output only. The lifecycle state of the label including whether it's published, deprecated, and has draft changes.
  *   `lockStatus` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LockStatus.t`, *default:* `nil`) - Output only. The LockStatus of this label.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the label. Will be in the form of either: `labels/{id}` or `labels/{id}@{revision_id}` depending on the request. See `id` and `revision_id` below.
  *   `properties` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelProperties.t`, *default:* `nil`) - Required. The basic properties of the label.
  *   `publishTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this label was published. This value has no meaning when the label is not published.
  *   `publisher` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t`, *default:* `nil`) - Output only. The user who published this label. This value has no meaning when the label is not published.
  *   `revisionCreateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this label revision was created.
  *   `revisionCreator` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t`, *default:* `nil`) - Output only. The user who created this label revision.
  *   `revisionId` (*type:* `String.t`, *default:* `nil`) - Output only. Revision ID of the label. Revision ID might be part of the label `name` depending on the request issued. A new revision is created whenever revisioned properties of a label are changed. Matches the regex: `([a-zA-Z0-9])+`
  *   `schemaCapabilities` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelSchemaCapabilities.t`, *default:* `nil`) - Output only. The capabilities the user has on this label.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appliedCapabilities =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedCapabilities.t()
            | nil,
          :appliedLabelPolicy =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :creator => GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t() | nil,
          :customer => String.t() | nil,
          :disableTime => DateTime.t() | nil,
          :disabler => GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t() | nil,
          :displayHints =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelDisplayHints.t() | nil,
          :fields => list(GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Field.t()) | nil,
          :id => String.t() | nil,
          :labelType => String.t() | nil,
          :learnMoreUri => String.t() | nil,
          :lifecycle => GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Lifecycle.t() | nil,
          :lockStatus =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LockStatus.t() | nil,
          :name => String.t() | nil,
          :properties =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelProperties.t() | nil,
          :publishTime => DateTime.t() | nil,
          :publisher => GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t() | nil,
          :revisionCreateTime => DateTime.t() | nil,
          :revisionCreator =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t() | nil,
          :revisionId => String.t() | nil,
          :schemaCapabilities =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelSchemaCapabilities.t()
            | nil
        }

  field(:appliedCapabilities,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedCapabilities
  )

  field(:appliedLabelPolicy,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy
  )

  field(:createTime, as: DateTime)
  field(:creator, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo)
  field(:customer)
  field(:disableTime, as: DateTime)
  field(:disabler, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo)

  field(:displayHints, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelDisplayHints)

  field(:fields, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Field, type: :list)
  field(:id)
  field(:labelType)
  field(:learnMoreUri)
  field(:lifecycle, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Lifecycle)
  field(:lockStatus, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LockStatus)
  field(:name)
  field(:properties, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelProperties)
  field(:publishTime, as: DateTime)
  field(:publisher, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo)
  field(:revisionCreateTime, as: DateTime)
  field(:revisionCreator, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo)
  field(:revisionId)

  field(:schemaCapabilities,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelSchemaCapabilities
  )
end

defimpl Poison.Decoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Label do
  def decode(value, options) do
    GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Label.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2Label do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
